/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author dvasquez
 */
@Entity
@Table(name = "ordenDeTrabajo")
@NamedQueries({@NamedQuery(name = "OrdenDeTrabajo.findAll", query = "SELECT o FROM OrdenDeTrabajo o"), @NamedQuery(name = "OrdenDeTrabajo.findByNroOT", query = "SELECT o FROM OrdenDeTrabajo o WHERE o.nroOT = :nroOT"), @NamedQuery(name = "OrdenDeTrabajo.findByObra", query = "SELECT o FROM OrdenDeTrabajo o WHERE o.obra = :obra")})
public class OrdenDeTrabajo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "nroOT")
    private String nroOT;
    @Column(name = "obra")
    private int obra;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;
    @Column(name="empresa")
    private int empresa;

    public OrdenDeTrabajo() {
    }

    public OrdenDeTrabajo(String nroOT) {
        this.nroOT = nroOT;
    }

    public String getNroOT() {
        return nroOT;
    }

    public void setNroOT(String nroOT) {
        this.nroOT = nroOT;
    }

    public int getObra() {
        return obra;
    }

    public void setObra(int obra) {
        this.obra = obra;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public int getEmpresa() {
        return empresa;
    }

    public void setEmpresa(int empresa) {
        this.empresa = empresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nroOT != null ? nroOT.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdenDeTrabajo)) {
            return false;
        }
        OrdenDeTrabajo other = (OrdenDeTrabajo) object;
        if ((this.nroOT == null && other.nroOT != null) || (this.nroOT != null && !this.nroOT.equals(other.nroOT))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nroOT;
    }

}
